package com.s2paganini.util 
{
	import flash.display.DisplayObject;
	import flash.geom.Matrix;

	/**
	 * @author silvio paganini | s2paganini.com
	 */
	public class Flip 
	{
		public static const FLIP_HORIZONTAL : String = "flipHor";
		public static const FLIP_VERTICAL : String = "flipVer";
		public static const FLIP_BOTH : String = "flipBoth";
		
		static public function flipHorizontal(dsp : DisplayObject) : void
		{
			var matrix : Matrix = dsp.transform.matrix;
			matrix.a = -1;
			matrix.tx = dsp.width + dsp.x;
			dsp.transform.matrix = matrix;
		}

		static public function flipVertical(dsp : DisplayObject) : void
		{
			var matrix : Matrix = dsp.transform.matrix;
			matrix.d = -1;
			matrix.ty = dsp.height + dsp.y;
			dsp.transform.matrix = matrix;
		}
	}
}
